<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>西藏自治区人民政府 </title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
    }

    header {
      background-color: #fff;
      color: #f92e14;
      text-align: left;
      padding: 20px 150px;
    }

    header div {
      font-size: 45px;
      font-weight: 600;
      letter-spacing: 3px;
      font-family: 'Times New Roman', Times, serif;
    }

    nav {
      display: block;
      background-color: #333;
      color: white;
      text-align: center;
      display: flex;
      justify-content: space-evenly;
      position: sticky;
      top: 0;
    }

    nav a {
      color: white;
      text-decoration: none;
      margin: 0 5px;
      border-radius: 5px;
      cursor: pointer;
      height: 50px;
      line-height: 50px;
      width: 100px;
    }

    nav a:hover,
    nav a.active {
      background-color: #555;
    }

    iframe {
      width: 100%;
      height: 100vh;
      border: none;
    }

    .biglogo {
      width: 23rem;
    }
  </style>
</head>

<body>

  <header>
    <!-- <div>欢迎来到西藏</div> -->
    <div>
      <img src="http://www.xizang.gov.cn/images/szf-logo2023.png" class="biglogo">
    </div>
  </header>
  <nav>
    <a href="./home.html" onclick="setActive(this)" target="contentFrame" class="active">首页</a>
    <a href="./news.html" onclick="setActive(this)" target="contentFrame">要闻</a>
    <a href="./innovation.html" onclick="setActive(this)" target="contentFrame">信息公开</a>
    <a href="./administrative.html" onclick="setActive(this)" target="contentFrame">服务</a>
    <a href="./tour.html" onclick="setActive(this)" target="contentFrame">互动</a>
    <a href="./environment.html" onclick="setActive(this)" target="contentFrame">生态环境</a>
    <a href="./history.html" onclick="setActive(this)" target="contentFrame">历史沿革</a>
    <a href="./photo.html" onclick="setActive(this)" target="contentFrame">西藏相册</a>
  </nav>

  <div id="content">
    <iframe name="contentFrame" src="./home.html"></iframe>
  </div>

  <script>
    function setActive (element) {
      // 移除所有a标签的.active类
      document.querySelectorAll('nav a').forEach(function (a) {
        a.classList.remove('active')
      })

      // 给当前点击的a标签添加.active类
      element.classList.add('active')
    }
  </script>

</body>

</html>